package nju.jun.reader.tieba.model;

import java.util.ArrayList;
import java.util.List;

public class Tieba {
	
	private Tieba() {
		novels = new ArrayList<TiebaNovel>();
	}
	
	private static Tieba instance;
	
	public static synchronized Tieba instance() {
		if (instance == null) {
			instance = new Tieba();
		}
		return instance;
	}

	private List<TiebaNovel> novels;
	
	public List<TiebaNovel> getNovels() {
		return this.novels;
	}
	
	public synchronized boolean addNovel(TiebaNovel novel) {
		if (!novels.contains(novel)) {
			return novels.add(novel);
		}
		return false;
	}
	
}
